package com.heima.test;

import com.heima.common.dtos.ResponseResult;
import com.heima.wemedia.WemediaApplication;
import com.heima.wemedia.service.WmCommentService;
import org.apache.kafka.common.protocol.types.Field;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @Author: Xu
 * @Date: 2022/01/05/16:06
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WemediaApplication.class)
public class deleteCommnet {
    @Autowired
    private WmCommentService wmCommentService;

    /**
     * 测试MongoDB删除评论
     */
    @Test
    public void test_CommentDelete(){
        String commentId = "61d3955c09c24007b159d1f2";
        ResponseResult responseResult = wmCommentService.deleteComment(commentId);
    }

    /**
     * 删除评论回复
     */
    @Test
    public void test_deleteCommentRepay(){
        String  id = "60c06eab4e71825b1b14f0f6";
        ResponseResult responseResult = wmCommentService.deleteCommentRepay(id);
        System.out.println(responseResult.getCode()+""+responseResult.getErrorMessage());
    }
}
